package com.example.works;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TabHost;

public class Work06Tabhost extends AppCompatActivity {

    private TabHost tabhost;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_work06_tabhost);

        tabhost = findViewById(android.R.id.tabhost);

        tabhost.setup();

        tabhost.addTab(tabhost.newTabSpec("tab_01").setIndicator("要闻",null).setContent((R.id.tab_01)));
        tabhost.addTab(tabhost.newTabSpec("tab_02").setIndicator("热点",null).setContent((R.id.tab_02)));
        tabhost.addTab(tabhost.newTabSpec("tab_03").setIndicator("奥运专辑",null).setContent((R.id.tab_03)));

    }
}